package com.atguigu.springcloud.service;

import com.atguigu.springcloud.service.impl.PaymentHystrixFallbackService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 *
 * feign的方式调用远程接口
 * @author : zjj
 * @date : 2021/6/19 15:15
 */


@Component
//@FeignClient(value = "cloud-provider-hystrix-payment")
@FeignClient(value = "cloud-provider-hystrix-payment",fallback = PaymentHystrixFallbackService.class)
public interface PaymentHystrixService {
    @GetMapping("/payment/hystrix/ok/{id}")
    String paymentInfo_OK(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    String paymentInfo_TimeOut(@PathVariable("id") Integer id);
}
